/**
 * 医疗服务质询初始化模块，提供医疗服务编辑页面初始化组件功能
 * 
 * @Date: 2016-1-25
 * @author: Jackson wang
 * @version: 1.0
 * @since: 1.0
 */

define(["jquery","sysmanMain","valueUtil"],
		function($,sysmanMain,valueUtil) {
			
		'use strict';
		
		var rootid = 'dic-subject-win'
		var public_method ={		
			
			
			rowClick:function(index,data){
				
				if(window.console)
					console.info('inpatient rowClick event fired ...')
				var _config = sysmanMain.getModuConf('inpatientItemFee');
				if(_config ==null){
					_config = {}					
				}	
				
				_config.initQueryParams = {field:'patient_id',fieldVal:data.patient_id}
				sysmanMain.setModuConf('inpatientItemFee',_config)
				sysmanMain.medicalInpatientItemFeeSelect()
			},
			/**
			 * 初始化新增页面
			 * @param _options.record 列表选中行
			 * @param _options.form 页面form对象
			 * @param _options.rootId 页面根节点
			 */
			initEdit:function(_options){
				if(window.console)
					console.info('dicsubject initEdit event fired ...')
				var _rootpath = '/'+sysmanMain.getRootPath()
				
				var categoryQueryUrl='/dicCategory/query/getList.action'
				//判断form对象是否存在
				if(_options){
					
					var _el = $('#' + rootid + ' #item_id')						
					$(_el).combobox({								
						textField:'item_name',
						valueField:'item_id',								
						url:_rootpath + categoryQueryUrl,
						onSelect:function(record){
							$('#'+rootid +' #item_name').val(record.item_name)
						}
					})				
				}
			}
			
		}
		
		var private_method ={
			
			
		}
			
		
		return public_method;
			
})